﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    @if (Request.Browser.Browser.Contains("IE") && Request.Browser.Version.Equals("9.0"))
    { 
        <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8" />
    }
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>@ViewBag.Title</title>
    @Html.MetaAcceptLanguage()
    @*<link type="text/css" rel="stylesheet" href="@Url.VersionedContent("~/Content/kafeteria/Site.css")" />*@
    @*<link type="text/css" rel="stylesheet" href="@Url.Content("~/Content/themes/base/jquery-ui.css")" />*@
    @*<link type="text/css" rel="stylesheet" href="@Url.Content("~/Content/themes/redmond/jquery-ui-1.8.14.custom.css")" />*@
    <link type="text/css" rel="Stylesheet" href="@Url.VersionedContent("~/Content/kafeteria/css/layout.css")" />
    <!--[if IE 7]>

        <link type="text/css" rel="Stylesheet" href="@Url.VersionedContent("~/Content/kafeteria/css/layout-ie7.css")" />
        <link type="text/css" rel="Stylesheet" href="@Url.VersionedContent("~/Content/kafeteria/css/webgrids_ie7only.css")" />
      
    <![endif]-->
    <link type="text/css" rel="Stylesheet" href="@Url.VersionedContent("~/Content/kafeteria/css/webgrids.css")" />
    <link type="text/css" rel="Stylesheet" href="@Url.Content("~/Scripts/jqTools/css/overlay-password.css")" />
    <script type="text/javascript" src="@Url.Content("~/Scripts/jquery-1.6.4.min.js")"></script>
    @if (false)
    { <script src="~/Scripts/jquery-1.6.4-vsdoc.js" type="text/javascript"></script> }
    <script type="text/javascript" src="@Url.Content("~/Scripts/jqTools/jquery.tools.min.js")"></script>
    <script type="text/javascript" src="@Url.Content("~/Scripts/jquery-ui-1.8.14.min.js")"></script>
    <script type="text/javascript" src='@Url.Content("~/Scripts/UI/jquery.ui.tabs.min.js")'></script>
    <script type="text/javascript" src="@Url.Content("~/Scripts/jquery.easing.js")"></script>
    <script type="text/javascript" src="@Url.Content("~/Scripts/jquery.dimensions.js")"></script>
    <script type="text/javascript" src="@Url.Content("~/Scripts/jquery.accordion.js")"></script>
    <script type="text/javascript" src="@Url.Content("~/Scripts/jquery.unobtrusive-ajax.min.js")"></script>
    <script type="text/javascript" src="@Url.Content("~/Scripts/jquery.validate.min.js")"></script>
    <script type="text/javascript" src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")"></script>
    <script type="text/javascript" src="@Url.VersionedContent("~/Scripts/JS/Common.js")"></script>
    <script type="text/javascript" src="@Url.VersionedContent("~/Scripts/JS/Kafeteria/EMP_ChangePassword.js")"></script>
    <script type="text/javascript" src="@Url.VersionedContent("~/Scripts/JS/Kafeteria/PlatformOption.js")"></script>
    <link type="text/css" rel="stylesheet" href="@Url.VersionedContent("~/Content/LoadingSpinner.css")" />
    <script type="text/javascript" src="@Url.Content("~/Scripts/spin.js")"></script>
    <script type="text/javascript" src="@Url.Content("~/Scripts/jquery.ale.js")"></script>
    <script type="text/javascript" src="@Url.Content("~/Scripts/jquery.jcarousel.min.js")"></script>
    <link type="text/css" rel="Stylesheet" href="@Url.VersionedContent("~/Content/kafeteria/css/tablesorter.css")" />
    <script type="text/javascript" src="@Url.VersionedContent("~/Scripts/JS/Kafeteria/jquery.tablesorter.js")"></script>
    <script type="text/javascript" src="@Url.VersionedContent("~/Scripts/JS/Kafeteria/jquery.tablesorter.widgets.js")"></script>
    <script type="text/javascript" src="@Url.Content("~/Scripts/blur.js")"></script>
    <script type="text/javascript">
        var content;
        var lang = '@System.Threading.Thread.CurrentThread.CurrentUICulture.TwoLetterISOLanguageName';
        var customerId = '@X_Code.Benefit.Kafeteria.Web.Helpers.LoginHelper.GetCustomerId()';
        var loginPage = '/Kafeteria/' + lang + '/Employee/Login/' + customerId;
        var changePasswd_icon = '';

        if (content !== undefined) {
            if (content.Success)
                changePasswd_icon = '@Url.Content("~/Content/images/Milky/l/44.png")';
            else
                changePasswd_icon = '@Url.Content("~/Content/images/Tango/32x32/actions/process-stop.png")';
        }
        else
            changePasswd_icon = '@Url.Content("~/Content/images/Tango/32x32/actions/process-stop.png")';

        $(function () {
            $.datepicker.setDefaults(
                $.extend(
                    $.datepicker.regional[lang]
                )
            )
        });
    </script>
    <style type="text/css">
		<!--

		@@font-face {
			font-family: 'Czcionka';
			src: url('@Url.Content("~/Content/fonts/tertre-xbol-webfont.eot")');
			src: url('@Url.Content("~/Content/fonts/tertre-xbol-webfont.eot?#iefix")') format('embedded-opentype'),
				 url('@Url.Content("~/Content/fonts/tertre-xbol-webfont.woff")') format('woff'),
				 url('@Url.Content("~/Content/fonts/tertre-xbol-webfont.ttf")') format('truetype'),
				 url('@Url.Content("~/Content/fonts/tertre-xbol-webfont.svg#Czcionka")') format('svg');
			font-weight: normal;
			font-style: normal;
		}

		/*Grafika tło*/
		/*.bg-img { background-image:url('@Url.Content("~/Content/kafeteria/images/bg/tlo-4.jpg")'); background-position: center top; background-repeat:repeat-x;}*/

		/*kolor*/
		/*.color,#top-menu ul li.color a,#mainmenu  ul li a,#platformmenu  ul li a,.sub-menu ul li a,.do-content h2, .do-content h1,.suma,.cena-big,.ui-tabs .ui-tabs-nav li a,#logowanie-box h1 { color:#371708;}*/

		/*tlo i przyciski*/

		/*.kolor-btn.xbutton, .kolor-btn.xbutton:visited, .kolor-btn.xbutton:hover, .bg-color  { background-color: #FE9B00; }*/

		/*kolor jasniejszy*/
		/*.pasek h3 a:hover, .pasek-2 h3 a:hover,.xbutton:hover, #down-content,.zawartosc  .ui-state-active h3 a, .zawartosc  .selected h3 a,#komunikaty a, .infolinia {color:#bf8c65;}*/
		-->
	</style>
    @RenderSection("head", required: false)
</head>
<body class="bg-color bg-img">
    <div id="pod-top">
        <div id="pod-top-2" class="pod-top-2">
            <div id="top-con">
                <div id="top">
                    <div id="witaj">
                        <span>@Html._("Witaj")</span> <span>@ViewBag.CurrentUser.Name @ViewBag.CurrentUser.Surname</span></div>
                    <div id="top-menu">
                        @if (ViewContext.Controller.ValueProvider.GetValue("controller").RawValue.ToString() == "Home")
                        { 
                            <ul>
                                @if (ViewBag.PlatformOptionName != null)
                                {
                                    <li><a href="#" rel="#optionBox" onclick="reloadOptionContent()" style="text-decoration: none">@ViewBag.PlatformOptionName</a></li>    
                                }
                                <li><a id="FancyBoxPasswordLink" style="text-decoration: none">@Html._("Moje dane")</a>
                                </li>
                                <li class="bigger color"><a href="@Url.Action("Logout", "Employee", new { id = ViewBag.CustomerLinkNameId })">@Html._("Wyloguj się")</a></li>
                                <li class="last">
                                    <div class="flag_parent">
                                        <img src="/Content/images/lang-en.png" alt="English" class="flag_uk" style="width:20px;height:20px;">
                                        <img src="/Content/images/lang-pl.png" alt="Polski"  class="flag_pl" style="width:20px;height:20px;">
                                    </div>
                                </li>
                            </ul>
                        }
                    </div>
                    <div class="clear">
                    </div>
                    <div id="logo-1">
                        <img src="@Url.Content("~/Content/kafeteria/images/blank.png")" />
                    </div>
                    <div id="banner-1">
                        <img src="@Url.Content("~/Content/kafeteria/images/blank.png")" />
                    </div>
                    <div id="logo-2">
                        <img src="@Url.Content("~/Content/kafeteria/images/blank.png")" />
                    </div>
                </div>
                <div id="mainmenu">
                    <div class="jcarousel-skin">
                        <div id="mycarousel" class="arrow1">
                            @RenderSection("menu", required: true)
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div id="kon-con">
        <div id="komunikaty">
            @*@if (ViewContext.Controller.ValueProvider.GetValue("controller").RawValue.ToString() == "Home")
            {
                @Html.Action("SessionInfo")
            }
            else
            { *@ @*<h2 class='color' style="font-family: Czcionka;">@Html._("Podgląd wybranej platformy.")<br />
                    @*<span style="font-size: smaller;">Wszystkie przyciski na tym ekranie zostały dezaktywowane.</span>*@
            @*</h2>*@ @*}*@ @*<a class="change-frequency" href="@Url.Action("ChangeFrequency","Home")">Zmiana częstotliowści składania zamówienia &raquo;</a>*@
        </div>
    </div>
    <div id="main-con">
        @RenderBody()
        <div id="down-content">
            <div class="infolinia">
                @Html._("Infolinia:") (22) 34 99 500</div>
            <div class="czynna">
                @Html._("czynna 7 dni w tygodniu, w godzinach 7-22, z wyłączeniem świąt państwowych i religijnych")</div>
            <div class="copy">
                &copy; @Html._("2011 Benefit Systems SA | Realizacja: X-CODE")</div>
        </div>
    </div>
    <div id="passwordBox">
        <div>
            @if (ViewContext.Controller.ValueProvider.GetValue("controller").RawValue.ToString() == "Home")
            {
                <h2 id="h2_cp">@Html._("Zarządzanie kontem")</h2>
                @Html.Action("ChangePassword", "Employee")
            }
        </div>
    </div>
    <div id="optionBox" style="display: none;">
        <div>
            @if (ViewContext.Controller.ValueProvider.GetValue("controller").RawValue.ToString() == "Home")
            {
                <h2 id="h2_cp" style="padding: 5px;">@ViewBag.PlatformOptionName</h2>
                @Html.Action("PlatformOption", "Home")
            }
        </div>
    </div>
    <script type="text/javascript">
        $(function () {
            $.fancybox.init();

            //$("a[rel]").overlay({
            //    top: 260,
            //    mask: {
            //        color: '#ccc',
            //        loadSpeed: 200,
            //        opacity: 0.5
            //    },
            //    closeOnClick: false,
            //    load: false
            //});

            $('.flag_pl').click(function () {
                var url = window.location.href.toString();
                url = url.replace('/en/', '/pl/');
                window.location.href = url;
            });
            $('.flag_uk').click(function () {
                var url = window.location.href.toString();
                url = url.replace('/pl/', '/en/');

                window.location.href = url;
            });
        });

        var hex = platformGraphicList[0].BackgroundColor;

        hex = (hex.charAt(0) == "#" ? hex.substr(1) : hex);

        if (hex.length == 6) {
            r = parseInt(hex.substring(0, 2), 16);
            g = parseInt(hex.substring(2, 4), 16);
            b = parseInt(hex.substring(4, 6), 16);
        }
        else if (hex.length == 3) {
            r = parseInt(hex.substring(0, 1) + hex.substring(0, 1), 16);
            g = parseInt(hex.substring(1, 2) + hex.substring(1, 2), 16);
            b = parseInt(hex.substring(2, 3) + hex.substring(2, 3), 16);
        }

        $("#optionBox>div>h2").css("background-color", "#" + platformGraphicList[0].ForegroundColor);
        $("#optionBox>div>h2").css("border", "1px solid #" + platformGraphicList[0].BackgroundColor);
        $("#optionBox").css("border", "10px solid #" + platformGraphicList[0].BackgroundColor);
        $("#optionBox").css("border", "10px solid rgba(" + r + "," + g + "," + b + ", 0.698)");
    </script>
    <a id="hidden_link" href="@Url.Action("ShowKafeteriaInformationBox")"></a>
    <script type="text/javascript">
        var controllerName = '@ViewContext.Controller.ValueProvider.GetValue("controller").RawValue';
        var action = '@ViewContext.Controller.ValueProvider.GetValue("action").RawValue';
        var showInformationBox = '@X_Code.Benefit.Kafeteria.Web.Helpers.InformationBoxHelper.IsInformationTextExists()';

        if (controllerName != null) {
            $('#' + 'liMain' + controllerName).addClass("active");

            if (action != null) {
                var splitResult = action.split('_');

                if (splitResult.length > 0) {
                    var splitAction = splitResult[0];

                    if (splitAction != null) {
                        var liTabId = '#' + 'li' + controllerName + 'Tab' + splitAction;
                        $(liTabId).addClass("active");
                    }
                }
            }
        }

        function ShowInformationBox() {
            url = '/Kafeteria/' + lang + '/Home/IsInformationExists';
            $.post(url, null, function (data) {
                if (data.toLowerCase() == 'true') {
                    showInformationBox = 'true';
                    PostShowInformationBox();
                }
                else {
                    showInformationBox = 'false';
                }
            });
        }

        function SetInformationBox(informationType, text) {
            url = '/Kafeteria/' + lang + '/' + controllerName + '/SetInformationBox';
            $.post(url, { informationType: informationType, text: text }, function (data) {
                showInformationBox = 'true';
                PostShowInformationBox();
            });
        }

        function PostShowInformationBox() {
            if (showInformationBox.toLowerCase() == 'true') {
                $("#hidden_link").fancybox({
                    'width': '50%',
                    'height': '50%',
                    'overlayColor': '#fff',
                    'autoDimensions': false,
                    'autoScale': true,
                    'transitionIn': 'none',
                    'transitionOut': 'none',
                    'type': 'ajax'
                }).trigger('click');
            }
        }

        function Collapse(element) {
            //Dla wszystkich tabel z platform
            var rows = $(element).find('tbody > tr[class*="row"]').length;
            var webgrid_type = '';

            var closestBlurOverlay = [];
            var closestLink = [];
            
            if (typeof ($(element).attr('id')) != 'undefined' && $(element).attr('id').indexOf('bundle_products_') != -1) {
                /* pakiety */
                webgrid_type = 'bundle';
            } else {
                /* limity */
                webgrid_type = 'limits';
            }

            closestBlurOverlay = $(element).prev();
            closestLink = $(element).closest('.in-content-content').closest('.in-content').prev('.pasek.long').find('h3 a');

            if (rows > 3) {
                if ($.browser.msie) {
                    //Z pozdrowieniami dla wszystkich użytkowników IE
                    var topOffset = 40; // $(element).find('thead tr').outerHeight();
                    $(element).find('tbody > tr[class*="row"]:lt(3)').each(function (index, element) { topOffset += $(this).outerHeight(); });

                    if (webgrid_type == 'bundle') {
                        $(closestBlurOverlay).css({ 'top': (topOffset) + 'px', 'height': '59px', 'display': 'block' });
                    } else {
                        $(closestBlurOverlay).css({ 'top': (topOffset) + 'px', 'height': '66px', 'display': 'block' });
                    }
                } else {
                    var r1 = $(element).find('tbody > tr[class*="row"]:eq(3)');
                    var r2 = $(element).find('tbody > tr[class*="row"]:eq(4)');
                    $(closestBlurOverlay).css({ 'display': 'none', 'height': '0' });
                    $(r1).blurjs();
                    $(r2).blurjs();
                }
            }

            if (rows > 3) {

                $(element).find('tbody > tr[class*="row"]:gt(4)').hide();
            }
            else {
                $(closestBlurOverlay).css({ 'display': 'none', 'height': '0' });
            }
        }

        function RollOut(element) {
            var closestBlurOverlay = $(element).prev();
            

            if ($.browser.msie) {
                $(closestBlurOverlay).css({ 'display': 'none', 'height': '0' });
                $(element).find('tbody > tr[class*="row"]:gt(4)').show();
            } else {
                //$.blurjs('reset');
                $(element).find('tbody > tr[class*="row"]').removeClass('blurjs-5-radius');
                $(element).find('tbody > tr[class*="row"]:gt(4)').show('slow');
            }
        }

        $('.amore').live('click', function (e) {
            /* Sztucznie klikamy na pasek.long h3 a */
            $(this).prev().find('a').trigger('click');
        });
        $('.pasek.long h3 a').live('click', function (e) {
            if ($(this).data('collapsed') == true) {
                //Rozwijamy
                $(this).data('collapsed', false);
                $(this).css('background-position', '877px -45px');
                RollOut($(this).closest('div.pasek').next('.in-content').find('.webgrid'));

            } else if ($(this).data('collapsed') == false) {
                //Zwijamy
                $(this).data('collapsed', true);
                $(this).css('background-position', '877px 7px');
                Collapse($(this).closest('div.pasek').next('.in-content').find('.webgrid'));
            }
        });

        //PostShowInformationBox();
    </script>
    <a id="hidden_link_change_password" href="#passwordBox" style="display: none" />
</body>
</html>
